package com.ptszyxx.popose.module.base.password;

import android.os.Bundle;

import androidx.lifecycle.ViewModelProviders;

import com.ptszyxx.popose.BR;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.ActivityPasswordForgetBinding;
import com.ptszyxx.popose.module.base.password.vm.PasswordForgetVM;
import com.ysg.base.BaseActivity;
import com.ysg.http.data.AppViewModelFactory;

/**
 * 忘记密码
 */
public class PasswordForgetActivity extends BaseActivity<ActivityPasswordForgetBinding, PasswordForgetVM> {
    @Override
    public int initContentView(Bundle savedInstanceState) {
        return R.layout.activity_password_forget;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public PasswordForgetVM initViewModel() {
        AppViewModelFactory factory = AppViewModelFactory.getInstance(getApplication());
        return ViewModelProviders.of(this, factory).get(PasswordForgetVM.class);
    }

    @Override
    public void initViewObservable() {
        viewModel.uc.onSendCodeEvent.observe(this, o -> binding.tvSendCode.startTimeCountDown());
    }
}
